'use strict';
module.exports = app => {
  const { INTEGER, DATE, STRING, NOW } = app.Sequelize;
  const Video = app.model.define('video', {
    video_id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    video_title: {
      type: STRING,
      defaultValue: '',
    },
    video_cover: {
      type: STRING,
      defaultValue: '',
    },
    video_url: {
      type: STRING,
      defaultValue: '',
    },
    description: {
      type: STRING,
      defaultValue: '',
    },
    keyword: {
      type: STRING,
      defaultValue: '',
    },
    visited: {
      type: INTEGER,
      defaultValue: 0,
    },
    created_at: {
      type: DATE,
      defaultValue: NOW,
    },
    owner: {
      type: STRING,
      defaultValue: '',
    },
    is_hot: {
      type: INTEGER,
      defaultValue: 0,
    },
  }, {
    timestamps: false,
    tableName: 'l_video',
  })

  return Video;
}
